package org.darcy.admin.filter;

import org.darcy.common.utils.SpringUtil;
import org.darcy.service.service.SystemAttachmentService;

/**
 * response路径处理
 */
public class ResponseRouter {

	public String filter(String data, String path) {
		boolean result = un().contains(path);
		if (result) {
			return data;
		}

		// 根据需要处理返回值
		if (data.contains("public/") && !data.contains("data:image/png;base64")) {
			data = SpringUtil.getBean(SystemAttachmentService.class).prefixImage(data);
		}

		return data;
	}

	public static String un() {
		return "";
	}
}
